<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.qm.hibernate.Tpost,com.qm.hibernate.Tblog,java.text.SimpleDateFormat"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>我的个人信息</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="../Css/styles.css">

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
</head>
<body>
	<%@ include file="../Public/myhomeHeader.jsp"%>
	<%
		List<Tpost> p = (List<Tpost>) session.getAttribute("myPost");
		List<Tblog> b = (List<Tblog>) session.getAttribute("myBlog");		
		Tuser user2 = (Tuser)session.getAttribute("user");
		SimpleDateFormat   formatter   =   new   SimpleDateFormat   ("yyyy-MM-dd");    
		String str= null; 
		if (user2.getBirthday()!=null)
		{
		 Date   curDate   = user2.getBirthday();//获取当前时间     
		 str   =   formatter.format(curDate);
		}
	%>
	
	
	<div id="container">
		<%@ include file="../Public/myLeft.jsp"%>
		<div id="middle">
			我的资料
			<ul>
				<form action = "myInfo">
					<label>名字</label><input type="text" name="name" value = <%=user.getName()%>><br /><br />
					<label>性别</label><select name = "gender">
					<option value = "男">男</option>
					<option value = "女" <%if(user.getGender()!=null && user.getGender().equals("女")) {%><%="selected" %><%} %>>女</option>
					</select>
					<br /> <br />
					<label>生日</label><input id = "input" type="text" name="birthday" value = <%=str%>>
					<br /> <br />
					<label>签名</label><input type="text" name="signature" value = <%=user.getSignature()%>><br /> <br />
					<label>地址</label><input type="text" name="address" value = <%=user.getAddress() %>><br /><br />
					<label>电话</label><input type="text" name="phoneNumber" value = <%=user.getPhoneNumber() %>><br /> <br />
					<label>空间访问限制</label>
					<select name = "permission">
						<option value="self" selected = "false"> 仅本人可见</option>
						<option value="friends">仅好友可见</option>
						<option value="all">全部人可见</option>
					</select> 
					<input type="submit" style="margin:0 0 0 35" />
				</form>
			</ul>
		</div>
		<div id="right" style = "float:right">
		帖子列表
			<ul>
				
			<%
				for (int i = 0;i < p.size();i++)
				{
			 %>
				<li><a href = "postAction?id=<%=p.get(i).getId() %>"> <%=p.get(i).getTitle() %></a></li>
			 <%
			 	}
			  %>
			  </ul>
			  <br/>
			  	  日志列表
			  <ul>
		
			  	<%
				for (int i = 0;i < b.size();i++)
				{
			 %>
				<li><a href = "myJournal?id=<%=b.get(i).getId()%>"> <%=b.get(i).getTitle() %></a></li>
			 <%
			 	}
			  %>
			</ul>

		</div>

	</div>

	<div id="footer"></div>
</body>
</html>
